package cn.tedu.zhyl.nurseManager.controller;

import cn.tedu.zhyl.base.response.JsonResult;
import cn.tedu.zhyl.nurseManager.pojo.dto.NurseRangeQuery;
import cn.tedu.zhyl.nurseManager.pojo.vo.NurseRangeVO;
import cn.tedu.zhyl.nurseManager.service.NurseRangeService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Slf4j
@RestController
@RequestMapping("/nurse/range/")
public class NurseRangeController {

    @Autowired
    private NurseRangeService nurseRangeService;

    @GetMapping("select")
    public JsonResult<List<NurseRangeVO>> select(NurseRangeQuery nurseRangeQuery) {
        log.debug("查询参数:{}",nurseRangeQuery);
        List<NurseRangeVO> list = nurseRangeService.getList(nurseRangeQuery);
        log.debug("返回结果：" + list);
        return JsonResult.ok(list);
    }
}
